<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../comm-header.jsp" %>
<%@ page language="java" import="java.net.URLEncoder,java.util.Map,java.util.HashMap" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, user-scalable=no">

<c:set var="contextPath" value="${pageContext.request.contextPath}" scope="application"/>
<title>新东网用户中心公共平台</title>
<meta name="viewport" content="width=device-width, initial-scale=1" user-scalable="no">
<link rel="shortcut icon" href="${contextPath}/favicon.ico" type="image/x-icon" />
<link href="${contextPath}${appStyleUrl}" rel="stylesheet">
<link href="${contextPath}/resources/yhzx/css/bootstrap.css" rel="stylesheet">
<link href="${contextPath}/resources/yhzx/css/animate.min.css" rel="stylesheet">
<script src="${contextPath}/resources/js/jquery.min.js"></script>
<script src="${contextPath}/resources/js/bootstrap.min.js"></script>
<script src="${contextPath}/resources/js/DES3.js"></script>
<script src="${contextPath}/resources/myjs/UCenterCommon.js"></script>
<script src="${contextPath}/resources/myjs/OAuthLogin.js"></script>
<script type="text/javascript" src="/UcConfig/uca/GlobalParams.js"></script>
</head>

<body>

<div class="wrapper doone bg1">
  	<%-- <div class="bg">
		<!-- <button type="button" class="sty1">默认</button> -->
		<!-- <button type="button" class="sty2">居中</button> -->
		<button type="button" class="bg1" onclick="changeBackGroupPic(1)"><img src="${contextPath}/resources/yhzx/img/bg_1.png" /></button>
		<button type="button" class="bg2" onclick="changeBackGroupPic(2)"><img src="${contextPath}/resources/yhzx/img//bg_2.png" /></button>
		<button type="button" class="bg3" onclick="changeBackGroupPic(3)"><img src="${contextPath}/resources/yhzx/img/bg_3.png" /></button>
	</div> --%>
  	
    <div class="container login">
    	<div class="logo animated fadeInUp"></div>
    	
    	<form id="loginForm" name="loginForm" action="${contextPath}/oauth/authorize" method="post">
    		<div class="login_error animated fadeInUp">${oauth_login_error_message}</div>
    		<div class="">
			    <input type="hidden" name="client_id" value="<%=java.net.URLEncoder.encode(request.getParameter("client_id") == null ? "" : (String) request.getParameter("client_id"))%>"/>
			    <input type="hidden" name="scope" value="<%=java.net.URLEncoder.encode(request.getParameter("scope") == null ? "" : (String) request.getParameter("scope"))%>"/>
			    <input type="hidden" name="response_type" value="<%=java.net.URLEncoder.encode(request.getParameter("response_type") == null ? "" : (String) request.getParameter("response_type"))%>"/>
			    <input type="hidden" name="redirect_uri" value="<%=java.net.URLEncoder.encode(request.getParameter("redirect_uri") == null ? "" : (String) request.getParameter("redirect_uri"))%>"/>
			    <input type="hidden" name="state" value="<%=java.net.URLEncoder.encode(request.getParameter("state") == null ? "" : (String) request.getParameter("state"))%>"/>
			    <input type="hidden" name="client_secret" value="<%=java.net.URLEncoder.encode(request.getParameter("client_secret") == null ? "" : (String) request.getParameter("client_secret"))%>"/>
		    </div>
		    <div class="input-group form animated fadeInUp">
	    		<input type="text" required name="username" value="<%=java.net.URLEncoder.encode(request.getAttribute("username") == null ? "" : (String) request.getAttribute("username"))%>" />
		    	<label alt="用户名" placeholder="用户名"></label>
		    </div>
		    <div class="input-group form animated fadeInUp">
	    		<input type="password" required id="password" name="password" value="">
		    	<label alt="密码" placeholder="密码"></label>
		    </div>
		    
		    <button type="submit" class="animated fadeInUp" id="login-button">
		    	登&nbsp;&nbsp;录
		    </button>
			
			<div class="other animated fadeInUp">
		 		<a class="forgot-password" id="myModalLink"></a>
		 		<span>|</span>
				<a class="email" href="http://202.101.116.85:18792/dc/mailbox/mailbox.action"></a>
		    </div>
	 	</form>

	    <%---forgot-password---%>
		<div class="forgot-p container2">
			<button type="button" class="btn" id="Fpassword">找回密码</button>
			<button type="button" class="btn" id="phoneLogin">使用手机验证码登录</button>
		</div>
	    
    </div>
    <%-- 
 		 时间：2017-08-21
    	描述：login  end
	--%>
    
    <div class="container password">
		<form class="register-form" id="resetForm">  
			<div class="head_title animated fadeInUp">
	        	<span class="title">找回密码</span>
	    		<p>验证码将会发送至你的手机</p>
			</div>
			
			<div class="form animated fadeInUp">
				<input required type="text"  id="userAccount" class="">
				<label alt="账号名" placeholder="账号名"></label>
			</div>
			<div class="form animated fadeInUp">
				<input required type="text" id="mobilePhone" placeholder="" class="">
				<label alt="手机号" placeholder="手机号"></label>
			</div>

			<div class="test animated fadeInUp">
				<input required type="text"   id="code" >
				<label alt="验证码" placeholder="验证码"></label>
				<a class="active" onclick="OAuthLogin.sendMessage(this)">点击获取</a>
			</div>
			
			<button type="button" name="password" class="btn animated fadeInUp" onclick="OAuthLogin.resetPassword()">重置密码</button>
			<button type="button" class="btn back animated fadeInUp" name="Submit" id="back" >返回</button>
		</form>
	</div>
	<%--
    	时间：2017-08-21
    	描述：password  end
    --%>
    
    <div class="container phone-login">
    	<form class="register-form" id="smsLoginForm" action="${contextPath}/oauth/smsRedirectAuth" method="post">
			<div class="">
				<input type="hidden" name="client_id" value="<%=java.net.URLEncoder.encode(request.getParameter("client_id") == null ? "" : (String) request.getParameter("client_id"))%>"/>
			    <input type="hidden" name="scope" value="<%=java.net.URLEncoder.encode(request.getParameter("scope") == null ? "" : (String) request.getParameter("scope"))%>"/>
			    <input type="hidden" name="response_type" value="<%=java.net.URLEncoder.encode(request.getParameter("response_type") == null ? "" : (String) request.getParameter("response_type"))%>"/>
			    <input type="hidden" name="redirect_uri" value="<%=java.net.URLEncoder.encode(request.getParameter("redirect_uri") == null ? "" : (String) request.getParameter("redirect_uri"))%>"/>
			    <input type="hidden" name="state" value="<%=java.net.URLEncoder.encode(request.getParameter("state") == null ? "" : (String) request.getParameter("state"))%>"/>
			    <input type="hidden" name="client_secret" value="<%=java.net.URLEncoder.encode(request.getParameter("client_secret") == null ? "" : (String) request.getParameter("client_secret"))%>"/>
  				<input type="hidden" name="url" id="pageUrl">
        	</div> 
        	
        	<div class="head_title animated fadeInUp">
	        	<span class="title">手机验证登录</span>
	    		<p>验证码将会发送至你的手机</p>
			</div>	
			<div class="form animated fadeInUp">
				<input required type="text" class="" id="account" name="userAccount" placeholder="">
				<label alt="账号名" placeholder="账号名"></label>
			</div>
			<div class="form animated fadeInUp">
				<input required type="text" class="" id="phone" name="mobilePhone" placeholder="">
        		<label alt="手机号" placeholder="手机号"></label>
			</div>
        	<div class="test animated fadeInUp">
				<input required type="text" class="" id="Code" name="smsCode" placeholder="">
				<label alt="验证码" placeholder="验证码"></label>
				<a class="yzm1" onclick="OAuthLogin.sendMessageLogin(this)">点击获取</a>
			</div>	
			
			<button type="button" name="qddr" class="btn animated fadeInUp" onclick="OAuthLogin.SMSLogin()">确定登录</button>
			<button type="button" class="btn back animated fadeInUp" name="Submit">返回</button>
		</form>
    </div>
    
</div>
	


<script type="text/javascript">
$(function(){
	$('#login-button').click(function(event){
		event.preventDefault();
		$('#login-button').addClass('logined');//登录加载动画
		UCenterCommon.loginSubmit();
	});
	$('.forgot-password').click(function(event){
		event.preventDefault();
		$('.wrapper').addClass('forgotP');//显示找回密码
	});
	
	$('#Fpassword').click(function(event){
		event.preventDefault();
		$('.wrapper').removeClass('forgotP');
		$('.wrapper').addClass('Password');//找回密码
	});
	
	$('.back').click(function(event){
		event.preventDefault();
		$('.wrapper').removeClass('Password');
		$('.wrapper').removeClass('Phone-login');//找回密码
	});
	
	$('#phoneLogin').click(function(event){
		event.preventDefault();
		$('.wrapper').removeClass('forgotP');
		$('.wrapper').removeClass('Password');
		$('.wrapper').addClass('Phone-login');//手机找回密码
	});
	
	$('.sty1').click(function(event){
		event.preventDefault();
		$('.wrapper').removeClass('doone');//切换背景
		$('.wrapper').addClass('doone_line');//切换背景
	});
	$('.sty2').click(function(event){
		event.preventDefault();
		$('.wrapper').removeClass('doone_line');//切换背景
		$('.wrapper').addClass('doone');//切换背景
	});
});
</script>

<script type="text/javascript">
	document.onkeydown = keyListener;
	function keyListener(e) {
		e = e ? e : event;
		if (e.keyCode == 13) {
			UCenterCommon.loginSubmit();
		}
	}
	OAuthLogin.initPage();
	
</script>

<%----手机端input禁止放大 --%>
<script>
    if(/Android (\d+\.\d+)/.test(navigator.userAgent)){
       var version = parseFloat(RegExp.$1);
    if(version>2.3){
       var phoneScale = parseInt(window.screen.width)/720;
       document.write('<meta name="viewport" content="width=320, minimum-scale = '+ phoneScale +', maximum-scale = '+ phoneScale +', user-scalable=no">');
       }else{
            document.write('<meta name="viewport" content="width=320">');
       }
       }else{
            document.write('<meta name="viewport" content="width=320, user-scalable=no">');
       }
</script>
  
</body>
</html>
